﻿@using WebSite.Views
@using WebSite.ViewModels
@using ControleRepresentante.Logic.Models
           
@model Pedido
           
@using (Html.BeginForm("AddPost", "Pedido", new { id = Model.Id }, FormMethod.Post, new { id = "addPostForm", name = "addPostForm" }))
{
    @Html.TextArea("Comentario", new {cols = 70, rows = 10})
    <br />
    @Html.Buttons().Add(ButtonType.Insert, "#", "Salvar", "javascript:addPostForm.submit()")
}

@foreach (Post post in Model.Posts.OrderByDescending(x => x.Data))
{
    <fieldset>
        <legend>@(post.User.Username + " - " + post.Data.ToString())</legend>
        @post.Comentario
    </fieldset> 
}